#ifndef CIPODPROTOCOL_H_
#define CIPODPROTOCOL_H_

#include "CIpodProxy.h"

#define IPOD_PACKET_MAX_LENGTH  0xFFFC

#ifdef __cplusplus
extern "C"{
#endif

class CIpodProtocol {
public:
    CIpodProtocol();
    virtual ~CIpodProtocol();

    void registerProxy(CIpodProxy *proxy);
    void unregisterProxy();

    virtual int init(int connMode) = 0;
    virtual int deinit() = 0;
    virtual int packetProc(const uint8 *data, uint16 len, bool native) = 0;

    virtual int notifyBtStatus(bool connected) = 0;
    virtual int notifyUSBAudioStatus(bool enabled) = 0;
    virtual int sendMediaCommand(int command) = 0;
    virtual int sendMediaCommandDown(int command) = 0;
    virtual int sendMediaCommandUp(int command) = 0;
    virtual int setPlayingTrackPosition(uint32 position) = 0;
    virtual int getShuffleMode(int *mode) = 0;
    virtual int getRepeatMode(int *mode) = 0;
    virtual int getPlayingTrackDuration(int * duration) = 0;
    virtual int getPlayingTrackTitle(std::string &title) = 0;
    virtual int getPlayingTrackAlbum(std::string &album) = 0;
    virtual int getPlayingTrackArtist(std::string &artist) = 0;
    virtual int getPlayingTrackAlbumArtwork() = 0;
    virtual int getPlayStatus(IPODPlayStatus *status) = 0;
    virtual int getPlayingTrackInfo(int32 *index, uint32 *count) = 0;
    virtual int getPlayingChapterInfo(int32 *index, uint32 *count) = 0;
    virtual int isListLevelSupported(bool *supported) = 0;
    virtual int resetMusicList(uint32 *num) = 0;
    virtual int selectMusicList(int32 index, int32 level, uint32 *num) = 0;
    virtual int selectMusicPlayingList(int32 index) = 0;
    virtual int getMusicList(uint32 startIndex, uint32 readCount, IPODMusicList *musicList) = 0;
    virtual int getMusicList_c(uint32 startIndex, uint32 readCount, C_IPODMusicList *musicList) = 0;
    virtual int getMusicPlayingList(uint32 startIndex, uint32 readCount, C_IPODMusicList *musicList) = 0;
    virtual int launchApp(const char *appBundleID) = 0;
    virtual int sendEAData(const uint8 *data, uint16 len) = 0;
	virtual int getDeviceInformation() = 0;
    virtual int setLocationInformation(const char *sentence) = 0;
    virtual int carPlayStartSession(int type) = 0;
    virtual int oOBBTPairingCompletionInformation(int resultCode ) = 0;
    virtual int bluetoothPairingAccessoryInformation(const char * inPairingDataP192,const char * inPairingDataP256) = 0;
    virtual int bluetoothPairingStatus( int success, const char * cancelReason) = 0;

protected:
    ipod_t getHandle();
    int send(const uint8 *data, uint16 len, bool native = false);
    bool isDeviceExist();
    bool isExiting();

private:
    CIpodProxy *m_Proxy;
};
#ifdef __cplusplus
}
#endif
#endif /* CIPODPROTOCOL_H_ */
